package tech.aistar.mapper;

import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;
import tech.aistar.entity.Film;
import tech.aistar.entity.Order;

import java.util.List;

/**
 * 本类用来演示
 *
 * @author success
 * @date 2023/3/12 21:40:21
 */
public interface OrderMapper {

    @Select("select * from mm_order")
    List<Order> findAll();

    @Select("select * from mm_order where id = #{id}")
    Order getOrder(int id);

    @Delete("delete from mm_order where id=#{id}")
    int delete(int id);

    @Insert("insert into mm_film (id,number,ordertime,userid,filmid,filmname,showid,show_showdate,show_showtime,show_price,show_price,show_seat,seat_status")
    int save(Order order);

    @Update("update mm_order set id=#{id},number=#{number},ordertime=#{ordertime},userid=#{userid},filmid=#{filmid},filmname=#{filmname},showid=#{showid},show_showdate=#{show_showdate},show_showtime=#{show_showtime},show_price=#{show_price},show_seat=#{show_seat},seat_status=#{seat_status}")
    int update(Order order);
}
